package com.example.neusoft215gdh.androidpro_21.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.example.neusoft215gdh.androidpro_21.JavaBean.BannerView;
import com.example.neusoft215gdh.androidpro_21.R;

import java.util.ArrayList;
import java.util.List;

import static com.example.neusoft215gdh.androidpro_21.R.drawable.b;
/**
 * Created by hp-pc on 2017/10/16.
 */
public class ClubVideoActivity  extends AppCompatActivity implements View.OnClickListener{

    private int[] imgs = {R.drawable.a, b,R.drawable.c,R.drawable.d};
    private List<View> viewList;
    BannerView bannerView;
    ImageView reg_returnVideo;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.club_video);
        viewList = new ArrayList<View>();
        for (int i = 0; i < imgs.length; i++) {
            ImageView image = new ImageView(this);
            image.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
            //设置显示格式
            image.setScaleType(ImageView.ScaleType.CENTER_CROP);
            image.setImageResource(imgs[i]);
            viewList.add(image);
        }
        bannerView = (BannerView) findViewById(R.id.bannerVideo);
        bannerView.startLoop(true);
        bannerView.setViewList(viewList);
//        bannerView.setTransformAnim(true);
        reg_returnVideo.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.reg_returnVideo:
                finish();
                break;
        }
    }
}
